<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link rel="stylesheet" href="__PUBLIC__/css/loginV2.css?v20160625" />
<script type="text/javascript" src="__DATA__/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="__DATA__/static/jq_plugins/layer/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/loginV2.js?v20160625000"></script>

</head>	
<body>
	
	<div class="main">
		<div class="canvas">
			<canvas id="canvas"></canvas>
		</div>
		<div class="form">
		    <div class="box">
		        <h1>Login</h1>
		        <form action="" method="post" id="LoginForm">
			        <input type="text" name="username" placeholder="UserName" value="admin">
			        <input type="password" name="password" placeholder="PassWord">
			        <input type="submit" placeholder="Login">
		    	</form>
		    </div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$('#LoginForm').submit(function(){
		event.preventDefault();
		var data = $('#LoginForm').serialize();
		layer.msg('login...');
		$.ajax({
	        url:"{:U('Login/login')}",
	        method:'post',
	        data:data,
	        dataType:'JSON',
	        success:function(res){
	            if(res.code == 200){
	             	window.location.href = "{:U('Index/index')}";
	            }else{
					layer.closeAll();
					layer.alert(res.msg);
	          	}
	            
	        },
	        error:function (data) {
				layer.closeAll();
				layer.alert('服务器繁忙');
	        }
	    })
	      return false;
	});


</script>
</html>